﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _12ExtractFromURL
{
    class Program
    {
        static void Main(string[] args)
        {
            string URL = "http://www.devbg.org/forum/index.php";
            int indexOfTwoPoints = URL.IndexOf(':');
            int indexOfThirdSlash = URL.IndexOf('/', indexOfTwoPoints + 3);
            string protocol = URL.Substring(0, indexOfTwoPoints);
            string server = URL.Substring((indexOfTwoPoints+3), (indexOfThirdSlash) - (indexOfTwoPoints + 3));
            string resource = URL.Substring(indexOfThirdSlash);
            Console.WriteLine("[protocol] = \"{0}\"", protocol);
            Console.WriteLine("[server] = \"{0}\"", server);
            Console.WriteLine("[resource] = \"{0}\"", resource);

        }
    }
}
